package com.yyt.esdemo.dao;

import com.yyt.esdemo.entity.User;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author yeyangtao
 * @date 2020/5/26 10:04
 */
@Repository
public interface UserDao extends ElasticsearchRepository<User, Integer> {
    @Query("{\"match\":{\"username\":\"?0\"}}")
    List<User> query(String name);

    List<User> findAllByUsername(String userName);
}
